package com.zbkj.service.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.dal.base.enums.ExpressOrderType;
import com.zbkj.dal.base.enums.OrderInvoceStatus;
import com.zbkj.dal.entity.order.OrderInvoice;
import com.zbkj.dal.pojo.response.OrderInvoiceResponse;
import com.zbkj.dal.pojo.vo.LogisticsResultVo;
import com.zbkj.service.model.dto.order.OrderInvoiceDTO;

import java.time.LocalDateTime;
import java.util.List;

/**
 * OrderInvoiceService 接口
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: CRMEB Team <admin@crmeb.com>
 * +----------------------------------------------------------------------
 */
public interface OrderInvoiceService extends IService<OrderInvoice> {

    /**
     * 获取订单发货单列表
     *
     * @param orderNo 订单号
     * @return 发货单列表
     */
    List<OrderInvoiceResponse> findByOrderNo(String orderNo);

    List<LogisticsResultVo> findTraceByOrderNoAndLastTraceOnly(String orderNo);

    OrderInvoiceDTO findOrderInvoiceByOrderNoAndInvoiceType(String orderNo, ExpressOrderType expressOrderType);

    OrderInvoiceResponse findOneByOrderNoAndOrderType(String orderNo, ExpressOrderType expressOrderType);

    OrderInvoice findByExpressOrderNo(String expressOrderNo);

    OrderInvoice findByTrackingNumber(String trackingNumber);

    OrderInvoceStatus updateOrderInvoiceStatusOnExpressTraceUpdate(String trackingNumber);

    void cnacelExpressOrder(String platOrderNo, ExpressOrderType expressOrderType);

    void updateExpressOrderPickupTime(String platOrderNo, ExpressOrderType expressOrderType, LocalDateTime pickupTime);
}